﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TZReport_Util.Basic;
using TZReport_Util.Util;

namespace TZReportUplaodForm
{
    public partial class tzReportForm : Form
    {
        public tzReportForm()
        {
            InitializeComponent();
        }

        private void btn_start_Click(object sender, EventArgs e)
        {
            string btnName = this.btn_start.Text;
            if (btnName == "开始")
            {
                QuartzHelper.ResumeTrigger();
                this.btn_start.Text = "正在执行";
            }
        }

        private void btn_suspend_Click(object sender, EventArgs e)
        {
            string btnName = this.btn_start.Text;
            if (btnName == "正在执行")
            {
                // 暂停
                QuartzHelper.PauseTrigger();
                this.btn_start.Text = "开始";
            }
        }

        private void tzReportForm_Load(object sender, EventArgs e)
        {
            QuartzHelper.StartScheduler();
            // 暂停
            QuartzHelper.PauseTrigger();
            this.Text = ConfigSource.formTitle;
        }

        private void tzReportForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            System.Environment.Exit(0);
        }
    }
}
